<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

@foreach($upresoult as $u)
<form action="{{url('Admin/article/'.$u->art_id)}}" method="POST" >
    <input type="hidden" value="put" name="_method">
    {{csrf_field()}}
    <table>
        <div style="background-color: #2ca02c">
            @if(count($errors)>0)
                @if(is_object($errors))
                    @foreach($errors->all() as $error)
                        <p>{{$error }}</p>
                    @endforeach
                @else
                    {{$errors}}
                @endif
            @endif
        </div>

        <tr>
            <th>分类:</th>
            <td><select name="cate_id">

                    <option value="0">==顶级分类==</option>


                    @foreach($addresoult as $v)

                        <option value="{{$v->cate_id}}"  @if($u->cate_id==$v->cate_id)selected="selected"@endif>{{--@if($v->cate_pid==0)┟@endif--}}{{$v->cate_name}}

                        </option>
                    @endforeach
                </select><br/></td>
        </tr>

            <tr>
                <th>
                    文章标题：
                </th>

                <td> <input type="text" name="art_title" size="50" value="{{$u->art_title}}"/><br/></td>
            </tr>
            <tr>
                <th>编辑:</th>
                <td><input type="text" name="art_editor" size="10" value="{{$u->art_editor}}"/><br/></td>
            </tr>

            <tr>
                <th>
                    缩略图:
                </th>
                <td>
                    <input type="text" name="art_thumb" size="50" value="{{$u->art_thumb}}"/>
                    <input id="file_upload" name="file_upload" type="file" multiple="true">
                    {{ csrf_field() }}
                    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
                    <script src="{{asset('resources/views/org/uploadify/jquery.uploadify.min.js')}}" type="text/javascript"></script>
                    <link rel="stylesheet" type="text/css" href="{{asset('resources/views/org/uploadify/uploadify.css')}}">

                    <script type="text/javascript">
                        <?php $timestamp = time();?>
                        $(function() {
                            $('#file_upload').uploadify({
                                'buttonText' : '图片上传',
                                'formData'     : {
                                    'timestamp' : '<?php echo $timestamp;?>',
                                    '_token'     : "{{csrf_token()}}"
                                },
                                'swf'      : "{{asset('resources/views/org/uploadify/uploadify.swf')}}",
                                'uploader' : "{{url('Admin/upload')}}",

                                'onUploadSuccess' : function(file, data, response) {

                                    $('input[name=art_thumb]').val(data);
                                    $('#art_thumb_img').attr('src','/'+data);
                                }

                            });
                        });
                    </script>
                    <style>
                        .uploadify{display:inline-block;}
                        .uploadify-button{border:none; border-radius:5px; margin-top:8px;}
                        table.add_tab tr td span.uploadify-button-text{color: #FFF; margin:0;}
                    </style>
                </td>

            </tr>

            <tr>
                <th>实时显示图片</th>
                <td><img src="/{{$u->art_thumb}}" alt="" id="art_thumb_img" style="max-width: 350px;max-width: 100px;"  ><br/></td>
            </tr>


            <tr>
                <th>
                    关键词：
                </th>
                <td> <textarea name="art_tag" style="width: 100%">{{$u->art_tag}}</textarea><br/></td>
            </tr>
            <tr>
                <th>
                    描述:
                </th>
                <td>
                    <textarea name="art_description" style="width: 100%">{{$u->art_description}}</textarea>
                    <br/>

                </td>
            </tr>

            <tr>
                <th>文章内容:</th>
                <td>
                    <script type="text/javascript" charset="utf-8" src="{{asset('resources/views/org/ueditor/ueditor.config.js')}}"></script>
                    <script type="text/javascript" charset="utf-8" src="{{asset('resources/views/org/ueditor/ueditor.all.min.js')}}"> </script>
                    <script type="text/javascript" charset="utf-8" src="{{asset('resources/views/org/ueditor/lang/zh-cn/zh-cn.js')}}"></script>
                    <script id="editor" name="art_content" type="text/plain" style="width:1024px;height:500px;">{!! $u->art_content !!}</script>

                    <script type="text/javascript">
                        var ue = UE.getEditor('editor');
                    </script>
                    <br/>

                </td>
            </tr>

            <tr>
                <td>
                    <input type="submit" value="提交" style="background-color: #1f648b;" size="50"/>
                    <input type="reset" value="返回"/>

                </td>
            </tr>
            @endforeach

    </table>


</form>
</body>
</html>